/*
 * Copyright (C) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package xiaofei.library.hermes.bean;

import ohos.utils.Parcel;
import ohos.utils.Sequenceable;

/**
 * BaseBean
 *
 * @author:Hexy
 * @since 2021-03-24
 */
public class BaseBean implements Sequenceable {
    private int val1;
    private boolean isVal2;
    private String val3;

    /**
     * 初始化
     */
    public BaseBean() {
    }

    /**
     * marshalling
     *
     * @param parcel
     * @return 是否成功
     */
    @Override
    public boolean marshalling(Parcel parcel) {
        parcel.writeInt(val1);
        parcel.writeBoolean(isVal2);
        parcel.writeString(val3);
        return true;
    }

    /**
     * unmarshalling
     *
     * @param parcel
     * @return 是否成功
     */
    @Override
    public boolean unmarshalling(Parcel parcel) {
        val1 = parcel.readInt();
        isVal2 = parcel.readBoolean();
        val3 = parcel.readString();
        return true;
    }

    /**
     * getVal1
     *
     * @return int
     */
    public int getVal1() {
        return val1;
    }

    /**
     * setVal1
     *
     * @param vale1
     */
    public void setVal1(int vale1) {
        this.val1 = vale1;
    }

    /**
     * isVal2
     *
     * @return boolean
     */
    public boolean isVal2() {
        return isVal2;
    }

    /**
     * setVal2
     *
     * @param isVal
     */
    public void setVal2(boolean isVal) {
        this.isVal2 = isVal;
    }

    /**
     * getVal3
     *
     * @return String
     */
    public String getVal3() {
        return val3;
    }

    /**
     * setVal3
     *
     * @param vale3
     */
    public void setVal3(String vale3) {
        this.val3 = vale3;
    }
}
